home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_5CCDDAE4E32A4D39898C472393AE92DA
< prev
next >
Wrap
Text File
|
2005-03-04
|
906b
|
46 lines
//simple per-pixel phong shading
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//combined world,view,projection transform
float4x4 matWorldViewProj;
//world transform
float4x4 matWorld;
//shader input
struct VS_INPUT
{
float4 Pos : POSITION;
float4 Normal : NORMAL;
float2 Tex0 : TEXCOORD0;
};
//shader output
struct VS_OUTPUT
{
float4 Pos : POSITION;
float3 Normal : TEXCOORD2;
float3 Pos2 : TEXCOORD1;
float2 Tex0 : TEXCOORD0;
float4 Clr : COLOR;
};
//shader code
VS_OUTPUT VShader(VS_INPUT In)
{
VS_OUTPUT Out;
//copy normal, and tex coord, set color
Out.Normal=mul(matWorld,In.Normal.xyz);
Out.Tex0=In.Tex0;
Out.Clr=float4(1,1,1,1);
//calc transformed position
Out.Pos=mul(matWorldViewProj,In.Pos);
Out.Pos2=mul(matWorld,In.Pos);
//spit out the results
return Out;
}